<cfsetting enablecfoutputonly="Yes">

<!--- 
  /**
   * Basic set of UDF's that we really need before we can process our indexes.
   *
   * @author  <info@mireau.net>
   * @version 1.0 - <yyyy/mm/dd>
   */
--->

<cfscript>
  /**
   * Will make a 'standard' way of representing a path. All backslashes will be
   * converted to slashes, and trailing and leading slashes will be removed.
   *
   * @author  email@mingo.nl
   * @version 1.0 - 2003.11.11
   * @param   sPath
   * @return  Uniformed sPath
   */
  function pathFormat( sPath )
  {
    return( listChangeDelims( lCase( replace( sPath, '\', '/', "all" )), '/', '/' ));
  }

  /**
   * Returns the web-equivalent of the getCFPathToIndex() function
   *
   * @author  rens@joxx.nl
   * @version 1.0 - 2003.11.11
   */
  function getCurrentPath()
  {
    var sCallerPath     = request.udf.pathFormat( getDirectoryFromPath( getBaseTemplatePath()));
    var sBasePath       = request.udf.pathFormat( getDirectoryFromPath( sAnchorPath ));
    var sWebPathToIndex = listRest( replace( sCallerPath, sBasePath, '', "one" ), '/' );
    
    if( len( sWebPathToIndex ))
    {
      return( sWebPathToIndex );
    }
    
    return( '.' );
  }
  
  /**
   * Returns the web-equivalent of the getCFPathToIndex() function
   *
   * @author  rens@joxx.nl
   * @version 1.0 - 2003.11.11
   */
  function getAnchorPath()
  {
    return( listDeleteAt( sAnchorPath, listLen( sAnchorPath, '/' ), '/' ));
  }

  /* Copy to a scope that's visible everywhere troughout the application */
  request.udf.pathFormat      = pathFormat;
  request.udf.getCurrentPath  = getCurrentPath;
  request.udf.getAnchorPath   = getAnchorPath;
</cfscript>

<cfsetting enablecfoutputonly="No">